//
//  DutyLawTitleTableViewCell.m
//  MobileOffice
//
//  Created by jjkj on 16/11/8.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "DutyLawTitleTableViewCell.h"

@implementation DutyLawTitleTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier isNeedButton:(BOOL)isNeed{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.userInteractionEnabled=YES;
        _myTitleLabel=[MyControl creatLabelWithFrame:CGRectMake(8, 10, 80, 30) text:@""];
        _myTitleLabel.textAlignment=NSTextAlignmentCenter;
        _myTitleLabel.layer.masksToBounds=YES;
        _myTitleLabel.layer.cornerRadius=5;
        [self.contentView addSubview:_myTitleLabel];
        
        _messageLabel=[MyControl creatLabelWithFrame:CGRectMake(_myTitleLabel.x+_myTitleLabel.width+5, 15, 100, 20) text:@""];
        _messageLabel.textColor=[UIColor blackColor];
        //_messageLabel.font=FONT_17;
        [self.contentView addSubview:_messageLabel];
        
        _lineLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 49, IPHONE_WIDTH, 1)];
        _lineLabel.backgroundColor=BACKCOLOR_GRAY;
        [self.contentView addSubview:_lineLabel];
        
        if (isNeed) {
            _signButton=[UIButton buttonWithType:UIButtonTypeCustom];
            _signButton.frame=CGRectMake(IPHONE_WIDTH-98, 15, 90, 20);
//            [_signButton setBackgroundImage:[UIImage imageNamed:@"k_tishi@2x"] forState:UIControlStateNormal];
            [_signButton setTitle:@"查看法律法规" forState:UIControlStateNormal];
            [_signButton setTitleColor:COLOR_SKYBLUE forState:UIControlStateNormal];
            _signButton.titleLabel.font=FONT_14;
            [self.contentView addSubview:_signButton];
        }
        //[_signButton addTarget:self action:@selector(signButtonClick) forControlEvents:UIControlEventTouchUpInside];
        self.contentView.width=IPHONE_WIDTH;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
